﻿<%@ Page Language="C#" MasterPageFile="~/Admin/Content.master" AutoEventWireup="true"
	CodeFile="UserMaintain.aspx.cs" Inherits="Admin_UserMaintain" Title="Untitled Page"
	Theme="Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
	<asp:MultiView runat="server" ID="Views">
		<asp:View runat="server" ID="ViewShow">
			<div class="ColumnTitleDiv">
				<span class="ColumnName">
					<%Response.Write(clsColumnComp.GetNameByID(nColumnID));%>
				</span>
				<asp:LinkButton runat="server" ID="BtnAdd" Text="添加" CssClass="Add" OnClick="BtnAdd_OnClick"></asp:LinkButton></div>
			<table class="table">
				<tbody>
					<tr>
						<td>
							<asp:LinkButton runat="server" CommandArgument="0" ID="BtnSearchAll" Text="所有用户"
								OnClick="BtnSearchAll_OnClick"></asp:LinkButton>
							<asp:DropDownList runat="server" ID="DdlSearchUserGroup">
							</asp:DropDownList>
							&nbsp;&nbsp;<asp:LinkButton runat="server" ID="BtnSearch" Text="查询" OnClick="BtnSearch_OnClick"></asp:LinkButton>
						</td>
					</tr>
				</tbody>
			</table>
			<asp:GridView runat="server" ID="GrvUsers" CssClass="GridView" OnRowDataBound="GrvUsers_OnRowDataBound"
				OnRowEditing="GrvUsers_OnRowEditing" OnRowCancelingEdit="GrvUsers_OnRowCancelingEdit"
				OnRowUpdating="GrvUsers_OnRowUpdating" OnRowDeleting="GrvUsers_OnRowDeleting"
				OnDataBound="GrvUsers_OnDataBound">
				<Columns>
					<asp:TemplateField ItemStyle-Width="30px" HeaderText="选择">
						<ItemTemplate>
							<asp:CheckBox runat="server" ID="CbID" />
						</ItemTemplate>
					</asp:TemplateField>
					<asp:TemplateField HeaderText="序号" ItemStyle-Width="30px">
						<ItemTemplate>
							<%# GrvUsers.PageIndex * GrvUsers.PageSize + GrvUsers.Rows.Count + 1%>
						</ItemTemplate>
					</asp:TemplateField>
					<asp:TemplateField HeaderText="用户名">
						<ItemTemplate>
							<asp:Label runat="server" Text='<%# Eval("Username")%>'></asp:Label>
						</ItemTemplate>
						<EditItemTemplate>
							<asp:TextBox runat="server" ID="TxtUsername" Text='<%# Eval("Username")%>'></asp:TextBox>
						</EditItemTemplate>
					</asp:TemplateField>
					<asp:TemplateField HeaderText="密码">
						<ItemTemplate>
							<asp:Label ID="Label1" runat="server" Text='<%# Eval("Password")%>'></asp:Label>
						</ItemTemplate>
						<EditItemTemplate>
							<asp:TextBox runat="server" ID="TxtPassword" Text='<%# Eval("Password")%>'></asp:TextBox>
						</EditItemTemplate>
					</asp:TemplateField>
					<asp:TemplateField HeaderText="用户组">
						<ItemTemplate>
							<asp:Label ID="Label2" runat="server" Text='<%# Eval("UserGroup")%>'></asp:Label>
						</ItemTemplate>
						<EditItemTemplate>
							<asp:DropDownList runat="server" ID="DdlUserGroupModify">
							</asp:DropDownList>
						</EditItemTemplate>
					</asp:TemplateField>
					<asp:TemplateField HeaderText="单位">
						<ItemTemplate>
							<asp:Label ID="labDepartment" runat="server" Text='<%# Eval("Department")%>'></asp:Label>
						</ItemTemplate>
						<EditItemTemplate>
							<asp:DropDownList runat="server" ID="DdlDepartment">
							</asp:DropDownList>
						</EditItemTemplate>
					</asp:TemplateField>
					<asp:TemplateField ItemStyle-Width="80px" HeaderText="操作">
						<ItemTemplate>
							<asp:LinkButton runat="server" CommandName="Edit" Text="修改"></asp:LinkButton>
							<asp:LinkButton runat="server" CommandName="Delete" Text="删除" OnClientClick="javascript:return confirm('确认要删除吗？')"></asp:LinkButton>
						</ItemTemplate>
						<EditItemTemplate>
							<asp:LinkButton runat="server" CommandName="Update" Text="更新"></asp:LinkButton>
							<asp:LinkButton runat="server" CommandName="Cancel" Text="取消"></asp:LinkButton>
						</EditItemTemplate>
					</asp:TemplateField>
				</Columns>
			</asp:GridView>
			<div class="TableDelimiter">
			</div>
			<table class="Pages">
				<tbody>
					<tr>
						<td>
							<asp:LinkButton runat="server" ID="BtnMultiSelect" OnClick="BtnMultiSelect_OnClick"
								Text="全选反选"></asp:LinkButton>
							<span class="Delimiter"></span>
							<asp:LinkButton runat="server" ID="BtnMultiDelete" Text="删除所选" OnClick="BtnMultiDelete_OnClick"
								OnClientClick="javascript:return confirm('确认要删除所选吗？')"></asp:LinkButton>
							<span class="PageNav" style = "float: none;">
								<asp:LinkButton ID="BtnFirst" runat="server" Text="第一页" OnClick="BtnFirst_OnClick"></asp:LinkButton>
								<asp:LinkButton ID="BtnPrev" runat="server" Text="前一页" OnClick="BtnPrev_OnClick"></asp:LinkButton>
								<asp:LinkButton ID="BtnNext" runat="server" Text="后一页" OnClick="BtnNext_OnClick"></asp:LinkButton>
								<asp:LinkButton ID="BtnLast" runat="server" Text="最后一页" OnClick="BtnLast_OnClick"></asp:LinkButton>
								第<asp:Label runat="server" ID="LabNowPage"></asp:Label>页/共<asp:Label runat="server"
									ID="LabTotalPage"></asp:Label>页 </span>
						</td>
					</tr>
				</tbody>
			</table>
		</asp:View>
		<asp:View runat="server" ID="ViewAdd">
			<div class="ColumnTitleDiv">
				<span class="ColumnName">添加用户</span><asp:LinkButton runat="server" ID="BtnShow" CssClass="Add"
					OnClick="BtnShow_OnClick"></asp:LinkButton></div>
			<table class="TableForAdd">
				<tbody>
					<tr>
						<td class="FirstCol">
							用户名：</td>
						<td class="SecondCol">
							<asp:TextBox runat="server" ID="TxtUsername" CssClass="Text"></asp:TextBox></td>
					</tr>
					<tr>
						<td class="FirstCol">
							密码：</td>
						<td class="SecondCol">
							<asp:TextBox runat="server" ID="TxtPassword" TextMode="Password" CssClass="Text"></asp:TextBox></td>
					</tr>
					<tr>
						<td class="FirstCol">
							用户组：</td>
						<td class="SecondCol">
							<asp:DropDownList runat="server" ID="DdlUserGroupForAdd">
							</asp:DropDownList>
						</td>
					</tr>
					<tr>
						<td class="FirstCol">单位：</td>
						<td class="SecondCol">
							<asp:DropDownList runat="server" ID="DdlDepartmentForAdd"></asp:DropDownList>
						</td>
					</tr>
				</tbody>
			</table>
			<table class="Pages">
				<tbody>
					<tr>
						<td>
							<span class="Operation">
								<asp:LinkButton runat="server" Text="添加" ID="BtnNew" OnClick="BtnNew_OnClick"></asp:LinkButton></span></td>
					</tr>
				</tbody>
			</table>
		</asp:View>
	</asp:MultiView>
</asp:Content>
